﻿@model IEnumerable<Contoso.Domain.ViewModels.EnrollmentIndexData>

@{
    ViewBag.Title = "Enrollments";
}

<h2>Enrollments</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
   
        <th></th>
        <th>@Html.ActionLink("Number", "Index", new { sortOrder=ViewBag.CourseIDSortParm })</th>
        <th>@Html.ActionLink("CourseTitle", "Index", new { sortOrder=ViewBag.CourseTitleSortParm })</th>
         <th>@Html.ActionLink("Student", "Index", new { sortOrder=ViewBag.StudentSortParm })</th>
        <th>Grade</th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.EnrollmentID }) |
            @Html.ActionLink("Details", "Details", new { id=item.EnrollmentID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.EnrollmentID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CourseID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CourseTitle)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FullName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Grade)
        </td>
    </tr>
}

</table>
